from django.urls import path
from .views import *

urlpatterns = [
    # 前台首页
    path('', IndexViews.index, name="myhome_index"),
    # 图书列表
    path('list/<int:tid>', IndexViews.booklist, name="myhome_list"),
    # 详情
    path('detail/<int:bid>', IndexViews.detail, name="myhome_detail"),


    # 购物车列表
    path('cart/index', CartViews.index, name="myhome_cart_index"),
    # 加入购物车
    path('cart/add', CartViews.add, name="myhome_cart_add"),       # 更新购物车数量
    path('cart/edit', CartViews.edit, name="myhome_cart_edit"),
    # 删除购物车商品
    path('cart/delete', CartViews.delete, name="myhome_cart_delete"),


    # 订单结算页
    path('order/confirm', OrderViews.confirm, name="myhome_order_confirm"),
    # 创建订单
    path('order/create', OrderViews.create, name="myhome_order_create"),
    # 发起支付请求
    path('order/pay/<int:orderid>', OrderViews.buypay, name="myhome_order_pay"),
    # 个人中心 我的订单(支付后的跳转地址)
    path('order/mylist', OrderViews.mylist, name="myhome_order_mylist"),
    # 回调地址
    path('order/pay_result', PayViews.pay_result, name="myhome_pay_result"),
    path('order/pay_getresult', PayViews.pay_getresult, name="myhome_pay_getresult"),


    # 登录注册相关
    path('login', LoginViews.login, name="myhome_login"),
    path('dologin', LoginViews.dologin, name="myhome_dologin"),
    path('logout', LoginViews.logout, name="myhome_logout"),
    path('register', LoginViews.register, name="myhome_register"),
    path('doregister', LoginViews.doregister, name="myhome_doregister"),
    path('checkphone', LoginViews.checkphone, name="myhome_checkphone"),
    path('sendphone', LoginViews.sendphone, name="myhome_sendphone"),

]
